<layout name="mun" />
    <div class="operation_user clearfix">
        <div class="link fl"><a href="#">商城</a><span>&gt;&gt;</span><a href="#">管理员管理</a><span>&gt;&gt;</span>添加管理员</div>
        <div class="link fr">
            <a href="#" class="icon icon_i">首页</a><span></span>欢迎您！<span>Admin</span><a href="#" class="icon icon_e">退出</a>
        </div>
    </div>
    <div class="content clearfix">
        <div class="main">
            <!--右侧内容-->
            <div class="cont">
                <div class="title">添加管理员</div>
                <div class="details">
                	<div class="formDiv">
					  <div class="form-group">
					    <label for="userName" class="col-sm-2 control-label"></label>
					    <div class="col-sm-10">
					      <input  class="form-control" id="username" placeholder="请输入待添加用户名">
					    </div>
					  </div>
					  <div class="form-group">
					    <label for="password" class="col-sm-2 control-label"></label>
					    <div class="col-sm-10">
					      <input type="password" class="form-control" id="password" placeholder="密码">
					    </div>
					  </div>
					  <div class="form-group">
					    <label for="passwordRep" class="col-sm-2 control-label"></label>
					    <div class="col-sm-10">
					      <input type="password" class="form-control" id="passwords" placeholder="重复密码">
					    </div>
					  </div>
				<div class="form-group">
					    <label for="passwordRep" class="col-sm-2 control-label"></label>
					    <div class="col-sm-10">
					      <input class="form-control" id="email" placeholder="邮箱">
					    </div>
					  </div>
					  <div class="form-group">
					    <div class="col-sm-offset-2 col-sm-10">
					      <button id="tianjia" class="btn btn-primary">提交</button>
					    </div>
					  </div>
					</div>
                </div>
            </div>
        </div>
        <SCRIPT src="__JS__jquery-1.9.1.min.js" type="text/javascript"></SCRIPT>
        <script type="text/javascript">
        $(function(){
        	$('#tianjia').click(function(){
        		if($("#username").val() !="" || $("#email").val()!=""|| $("#password").val()!=""||$("#passwords").val()!=""){
        		$.post("{:U('AddAdmin/add')}",{
        			username:$("#username").val(),
        			email:$("#email").val(),
        			password:$("#password").val(),
        			passwords:$("#passwords").val()
        		},function(data){
        			if(data.status == 0){
        				alert(data.info);
        			}else{
        				alert(data.info);
        				location.href=data.url; 
        			}
        		});
        		}else{
        			alert("请完善表单信息");
        		}
        	});
        });
        </script>
        